home *** CD-ROM | disk | FTP | other *** search
- package mochi.as3
- {
- import flash.display.MovieClip;
-
- public class MochiEvents
- {
- private static var gameStart:Number;
-
- private static var levelStart:Number;
-
- public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
-
- public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
-
- public static const ALIGN_TOP:String = "ALIGN_T";
-
- public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
-
- public static const ALIGN_LEFT:String = "ALIGN_L";
-
- public static const ALIGN_CENTER:String = "ALIGN_C";
-
- public static const ALIGN_RIGHT:String = "ALIGN_R";
-
- public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
-
- public static const ALIGN_BOTTOM:String = "ALIGN_B";
-
- public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
-
- public static const FORMAT_SHORT:String = "ShortForm";
-
- public static const FORMAT_LONG:String = "LongForm";
-
- private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
-
- public function MochiEvents()
- {
- super();
- }
-
- public static function addEventListener(param1:String, param2:Function) : void
- {
- _dispatcher.addEventListener(param1,param2);
- }
-
- public static function _vc41() : void
- {
- var _loc1_:Number = NaN;
- _loc1_ = new Date().time - levelStart;
- trigger("end_level",{"time":_loc1_});
- }
-
- public static function _vl688(param1:MovieClip, param2:Object) : void
- {
- var _loc3_:Object = null;
- var _loc4_:Object = null;
- _loc3_ = {};
- for(_loc4_ in param2)
- {
- _loc3_[_loc4_] = param2[_loc4_];
- }
- _loc3_._cn696 = param1;
- MochiServices.send("events_setNotifications",_loc3_,null,null);
- }
-
- public static function _xc131() : void
- {
- gameStart = new Date().time;
- trigger("start_game");
- }
-
- public static function triggerEvent(param1:String, param2:Object) : void
- {
- _dispatcher.triggerEvent(param1,param2);
- }
-
- public static function _gq31() : void
- {
- var _loc1_:Number = NaN;
- _loc1_ = new Date().time - gameStart;
- trigger("end_game",{"time":_loc1_});
- }
-
- public static function removeEventListener(param1:String, param2:Function) : void
- {
- _dispatcher.removeEventListener(param1,param2);
- }
-
- public static function _bk630() : void
- {
- levelStart = new Date().time;
- trigger("start_level");
- }
-
- public static function _dr706(param1:String) : void
- {
- MochiServices.send("events_beginSession",{"achievementID":param1},null,null);
- }
-
- public static function trigger(param1:String, param2:Object = null) : void
- {
- if(param2 == null)
- {
- param2 = {};
- }
- else if(param2["kind"] != undefined)
- {
- trace("WARNING: optional arguements package contains key \'id\', it will be overwritten");
- param2["kind"] = param1;
- }
- MochiServices.send("events_triggerEvent",{"eventObject":param2},null,null);
- }
-
- public static function _rm99() : String
- {
- return MochiServices._rm99();
- }
- }
- }
-
-